
import pytest
from package_pytest.login import login


cases = [(1,'admin','123456'),(4,'admin','1234567'),(3,'admin',''),(2,'','123456')]


@pytest.fixture(params=cases)
def login_data(request):
    yield request.param


def test_login(login_data):
    expect_result = login_data[0]
    username = login_data[1]
    password = login_data[2]
    actual_result = login(username,password).get('code')

    assert expect_result == actual_result